   /**
    * Launches both the client and the server on the same host.
    */

public class CSLauncher {

   /**
    * @param args
    */
   public static void main(String[] args) throws Exception {
	  String servArgs[] = {"9101", "9105", "32", "32", "0.6"}; // With R=9, flow 1 needs a service ratio >= .5555      
      ServerThread serv = new ServerThread(servArgs);

      String source1Args[] = {"10","0","0","51","9101","10","10000", "true", "9109", "false"};
      SourceThread source1 = new SourceThread(source1Args);

      String source2Args[] = {"10","0","0","51","9105","10","10000", "true", "9113", "false"};
      SourceThread source2 = new SourceThread(source2Args);
      
      serv.start();
      source1.start();
      source2.start();
   }
   
   private static class ServerThread extends Thread {
      private String args[];
      
      public ServerThread(String in_args[]) {
         args = in_args;
      }
      
      public void run() {
         try {
            UDPServer.main(args);
         } catch(Exception e) {
            e.printStackTrace();
         }
      }
   }
   
   private static class SourceThread extends Thread {
	      private String args[];
	      
	      public SourceThread(String in_args[]) {
	         args = in_args;
	      }
	      
	      public void run() {
	         try {
	            UDPClient.main(args);
	         } catch(Exception e) {
	            e.printStackTrace();
	         }
	      }
	   }   

}
